<?php

/*
 * Copyright 2015 jiaojie <jiaojie1989@gmail.com>.
 * 
 * Check your synatx if it is right.
 * Check your variables if the names are just correct.
 * Finally, run it under your command line.
 * Enjoy it!
 */

namespace Home\Model;

use Think\Model;

/**
 *
 * @author jiaojie <jiaojie1989@gmail.com>
 * @date 2015-4-15
 * @version 1.0.0
 * @description
 */
class User extends Model {

    protected $trueTableName = 't_cms_user';

    public function getInfoByRandom() {
        $where = array(
            'type' => 1,
            'is_del' => 0,
        );
        $random = $this->where($where)->limit(4, 2)->order('rand()')->select();
        return $random;
    }

    public function getUserInfoByUserAccount($user_account) {
        $where = array(
            'user_account' => $user_account,
        );
        return $this->where($where)->select();
    }

}
